/*
 * @Author: wjk
 * @Date: 2020-09-15 16:18:21
 * @LastEditors: wjk
 * @LastEditTime: 2020-11-12 11:25:45
 * @description: file content
 */
import { requestNew } from '@/utils/request'

// SearchPlatform
export async function getSearchPlatform(params) {
  const res = await requestNew({
    url: '/bihs/search-platform/list',
    method: 'get',
    params: params || {}
  })
  return res
}

// banner
export async function getBanner(params) {
  const res = await requestNew({
    url: '/bihs/banner/list',
    method: 'get',
    params: params || {}
  })
  return res
}

// category
export async function getCategory(params) {
  const res = await requestNew({
    url: '/bihs/category/list',
    method: 'get',
    params: params || {}
  })
  return res
}

// goods
export async function getGoods(params) {
  const res = await requestNew({
    url: '/bihs/goods/search',
    method: 'post',
    data: params || {}
  })
  return res
}

// goods detail
export async function getGoodsDetail(params) {
  const res = await requestNew({
    url: '/bihs/goods/detail',
    method: 'get',
    params: params || {}
  })
  return res
}

// goods 优惠券
export async function getGoodsCoupon(params) {
  const res = await requestNew({
    url: '/bihs/activity/full-give/by/price',
    method: 'get',
    params: params || {}
  })
  return res
}

// goods share
export async function getShareUrl(params) {
  const res = await requestNew({
    url: '/bihs/goods/privilege/url',
    method: 'post',
    data: params || {}
  })
  return res
}

// 搜索初始化数据，含<输入框缺省值，热搜关键字>
export async function getSearchKey(params) {
  const res = await requestNew({
    url: '/bihs/goods/search/info',
    method: 'get',
    params: params || {}
  })
  return res
}

// 搜索初始化数据，含<输入框缺省值，热搜关键字>
export async function getStatusCode(params) {
  const res = await requestNew({
    url: '/bihs/auth/taobao/create',
    method: 'get',
    params: params || {}
  })
  return res
}
